package com.yazi.mxz.behavior.service.impl;

import javax.annotation.Resource;

import com.myframework.smhj.hibernate.Searching;
import com.myframework.smhj.hibernate.Page;
import com.yazi.mxz.behavior.dao.RegionDao;
import com.yazi.mxz.behavior.entity.beans.Region;
import com.yazi.mxz.behavior.service.RegionService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;


@Service("regionService")
public class RegionServiceImpl implements RegionService {
	private static Logger log = LoggerFactory.getLogger(RegionServiceImpl.class);
	
	@Resource
	RegionDao regionDao;
	
	@Override
	public Page<Region> listByGtUpdateTime(long updateTime, Searching si) {
		log.debug("listByGtUpdateTime：updateTime={},nowPage={}", updateTime, si.getNowPage());
		return regionDao.listByGtUpdateTime(updateTime, si);
	}

	@Override
	public Page<Region> list(Region region, Searching si) {
		log.debug("list：");
		return regionDao.listByExample(region, si);
	}
	
	@Override
	public Region modify(Region region) {
		log.debug("modify：{}", region.getName());
		return regionDao.merge(region);
	}
}
